import request from '@/utils/request'

export function getErrDetail(id) {
  return request({
    url: 'api/sysLog/error/' + id,
    method: 'get'
  })
}

export function delAllError() {
  return request({
    url: 'api/sysLog/del/error',
    method: 'delete'
  })
}

export function delAllInfo() {
  return request({
    url: 'api/sysLog/del/info',
    method: 'delete'
  })
}

export function restartWebFront(data) {
  return request({
    url: 'api/sysLog/restartWebFront/' + data,
    method: 'get'
  })
}

export function restartWebBackend(env,companyCode) {
  return request({
    url: 'api/sysLog/restartWebBackend',
    method: 'post',
    params: {
      "env":env,
      "companyCode":companyCode
    }
  })
}

export function packageJar(data) {
  return request({
    url: 'api/sysLog/packageJar/' + data,
    method: 'get'
  })
}

export function downloadJar(data) {
  return request({
    url: 'api/sysLog/downloadJar/' + data,
    method: 'get'
  })
}

export function restartAppletBackend(data) {
  return request({
    url: 'api/sysLog/restartAppletBackend/' + data,
    method: 'get'
  })
}

export function packageAppletJar(data) {
  return request({
    url: 'api/sysLog/packageAppletJar/' + data,
    method: 'get'
  })
}

export function downloadAppletJar(data) {
  return request({
    url: 'api/sysLog/downloadAppletJar/' + data,
    method: 'get'
  })
}

export function flushCache(data) {
  return request({
    url: 'api/sysLog/flushCache/' + data,
    method: 'get'
  })
}

export default { getErrDetail, delAllError, delAllInfo, restartWebFront, restartWebBackend, packageJar, downloadJar, restartAppletBackend, packageAppletJar, downloadAppletJar, flushCache }
